package com.example.management.system.service

import com.example.management.common.domain.Tree
import com.example.management.system.domain.DeptDO
import com.example.management.system.domain.UserDO
import com.example.management.system.vo.UserVO
import org.springframework.web.multipart.MultipartFile

interface UserService {
    operator fun get(id: Long?): UserDO

    fun list(map: Map<String, Any>): List<UserDO>

    fun count(map: Map<String, Any>): Int

    fun save(user: UserDO): Int

    fun update(user: UserDO): Int

    fun remove(userId: Long?): Int

    fun batchremove(userIds: Array<Long>): Int

    fun exit(params: Map<String, Any>): Boolean

    fun listRoles(userId: Long?): Set<String>?

    @Throws(Exception::class)
    fun resetPwd(userVO: UserVO, userDO: UserDO): Int

    @Throws(Exception::class)
    fun adminResetPwd(userVO: UserVO): Int

    fun getTree(): Tree<DeptDO>

    /**
     * 更新个人信息
     * @param userDO
     * @return
     */
    fun updatePersonal(userDO: UserDO): Int

    /**
     * 更新个人图片
     * @param file 图片
     * @param avatar_data 裁剪信息
     * @param userId 用户ID
     * @throws Exception
     */
    @Throws(Exception::class)
    fun updatePersonalImg(file: MultipartFile, avatar_data: String, userId: Long?): Map<String, Any>

}